﻿@model PagedInfo<ViewContentAndCate>
@{
    ViewData["Title"] = "搜索 " + ViewBag.keyword + " 结果";
    ViewData["SiteName"] = await SystemConfig.GetByFieldNameAsync("SiteName");
}
<div class="layui-container" style="margin-top:10px;">
    <div class="layui-bg-gray" style="padding:10px;">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                <div class="layui-panel" style="text-align:left;padding:10px;">
                    <span class="layui-breadcrumb">
                        <a href="/">Home</a>
                        <a><cite>@ViewData["Title"]</cite></a>
                    </span>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="layui-container">
    <div class="layui-card">
        <div class="layui-card-header"><h3>搜索关键字：@ViewBag.keyword</h3></div>
        <div class="layui-card-body">
            <div class="layui-col-md12">
                @foreach (var item in Model.Result)
                {
                    <div class="layui-panel cxuu-panel">
                        [<a href="/Home/List/Index/@item.Cid">
                            @(item.CateName)
                        </a>]
                        <a asp-area="Home" asp-controller="Info" asp-action="Index" asp-route-id="@item.Id" target="_blank">@item.Title </a><span class="float-right">@item.Time.ToString("d")</span>
                    </div>
                }
            </div>
        </div>
        <div id="laypage"></div>
    </div>
</div>

@section Scripts
    {
    <script>
        layui.use(['laypage', 'element', 'layer'], function () {
            var laypage = layui.laypage
                , layer = layui.layer
                , element = layui.element;

            laypage.render({
                elem: 'laypage'
                , count: '@Model.TotalNum'
                , limit: '@Model.PageSize'
                , groups: '@Model.TotalPage'
                , theme: '#1E9FFF'
                , curr: '@Model.PageIndex' //获取起始页
                //,hash: '/' //自定义hash值
                , prev: "上一页"
                , next: "下一页"
                , jump: function (obj, first) {
                    if (!first) {
                        location.href = '/Home/Search/Index/?keyword=@ViewBag.keyword&page=' + obj.curr;
                    }
                }
            });
        });

    </script>
}